home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / util / libs / chunky_dev.lha / chunky_dev / Demos / _shared / waitbutton.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-03-15  |  705 b   |  30 lines

  1. //
  2. // chunky.library demo
  3. // MODULE: waits for the close gadget of the window to be pressed
  4. //
  5. // http://www.irrelevant.org/~oondy/chunky/
  6. // Public Domain.  (c) 1999 Rosande Limited, all rights reserved.
  7. //
  8.  
  9. #include <exec/types.h>
  10. #include <intuition/intuition.h>
  11. #include <pragma/intuition_lib.h>
  12. #include <pragma/exec_lib.h>
  13.  
  14. #include "screen.h"
  15.  
  16. void DEMO_WaitForCloseGadget(void)
  17. {
  18.   BOOL terminated = FALSE;
  19.   struct IntuiMessage *imsg;
  20.   while(!terminated)
  21.   {
  22.     Wait(1<<DemoWindow->UserPort->mp_SigBit);
  23.     while(imsg = (struct IntuiMessage *)GetMsg(DemoWindow->UserPort))
  24.     {
  25.       if(imsg->Class == IDCMP_CLOSEWINDOW) terminated = TRUE;
  26.       ReplyMsg((struct Message *)imsg);
  27.     }
  28.   }
  29. }
  30.